home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / STL Headers / STL Notes < prev    next >
Encoding:
Text File  |  1995-04-30  |  4.4 KB  |  69 lines  |  [TEXT/ttxt]

  1.  
  2. STL Release Notes
  3.  
  4. What is STL?
  5.  
  6.     STL stands for Standard Template Library.  Standard not only because the library is a standard unto itself, but also because it has been incorporated into the draft ANSI C++ Standard.  Template because the library is comprised entirely of C++ templates for container classes and generic algorithms.  [Library, we hope, speaks for itself.]  STL is the fruit of several years of research on generic programming by Alexander Stepanov and Meng Lee of Hewlett-Packard Laboratories and David Musser of Rensselaer Polytechnic Institute.
  7.  
  8. What is STL for?
  9.  
  10.     To quote The Standard Template Library by Stepanov and Lee:
  11.  
  12.           “The Standard Template Library provides a set of well
  13.           structured generic C++ components that work together in a
  14.           seamless way. Special care has been taken to ensure that
  15.           all the template algorithms work not only on the data
  16.           structures in the library, but also on built-in C++ data
  17.           structures. For example, all the algorithms work on regular
  18.           pointers. The orthogonal design of the library allows
  19.           programmers to use library data structures with their own
  20.           algorithms, and to use library algorithms with their own
  21.           data structures. The well specified semantic and complexity
  22.           requirements guarantee that a user component will work with
  23.           the library, and that it will work efficiently. This
  24.           flexibility ensures the widespread utility of the library.”
  25.  
  26. Where can I find out more about STL?
  27.  
  28.     The Standard Template Library is included on this CD in DocViewer format.  It is a complete description of the library, although a very formal one without much in the way of rationale or examples.  Another excellent source of information on STL can be found on the World Wide Web.  Its URL is:
  29.  
  30.           http://www.cs.rpi.edu/~musser/stl.html
  31.  
  32. and it provides a wealth of material, including the STL Online Algorithm Reference, which is a collection of hypermedia “data sheets” describing all of STL’s generic algorithms.  Examples are provided with source code.  You can even run the examples online, as well as some additional animated examples, provided that you have MacX or other X-Window server software available.
  33.  
  34. How do I use STL?
  35.  
  36.     STL, being comprised solely of template declarations, resides completely in a set of header files:
  37.  
  38.        algo.h      - includes all the algorithms
  39.        algobase.h  - auxiliary file
  40.        bool.h      - simulates bool
  41.        bvector.h   - bit_vector
  42.        defalloc.h  - allocator
  43.        deque.h     - deque
  44.        function.h  - operators, function objects and function adaptors
  45.        heap.h      - auxiliary file
  46.        iterator.h  - iterator tags, stream iterators and iterator adaptors
  47.        list.h      - list
  48.        map.h       - map
  49.        multimap.h  - multimap
  50.        multiset.h  - multiset
  51.        pair.h      - pair
  52.        projectn.h  - auxiliary file
  53.        random.cpp  - random number generator. It should be compiled and linked
  54.                      if random_shuffle is used.
  55.        set.h       - set
  56.        stack.h     - container adaptors
  57.        tempbuf.cpp - an auxiliary buffer for get_temporary_buffer;
  58.                      it should be compiled and linked if get_temporary_buffer,
  59.                      stable_partition, inplace_merge or stable_sort are used.
  60.        tempbuf.h   - get_temporary_buffer
  61.        tree.h      - auxiliary file
  62.        vector.h    - vector
  63.  
  64. #include those header files you require or you can just #include <stl.h> to include everything.  A precompiled header <STL> is also provided, but if you need to use MacHeaders or any other precompiled header as well, you’ll need to build a custom precompiled header that incorporates them together. You can use the STL project used to build the STL precompiled header as a guide.
  65.  
  66. Note that the header <bvector.h> cannot be precompiled with the current compiler because it contains a static data declaration.  Also, if you are using <iterator.h> be sure to #include <iostreams.h> before you instantiate any iostream iterators. <iostreams.h> is not #included by <iterator.h> because <iostreams.h> also declares static data and #including it would preclude the possibility of incorporating <iterator.h> into any precompiled headers.
  67.  
  68. There are no “libraries” (in the linkable sense) that need to be added to your project.  However, some portions of STL make use of elements of the ANSI and ANSI++ libraries.
  69.